package com.tj.jinzao.activity;

import android.content.Intent;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.tj.jinzao.R;
import com.tj.jinzao.base.BaseActivity;
import com.tj.jinzao.fragment.FriendFragment;

/**
 * Created by LiuYX on 2019/4/19.
 */

public class FriendActivity extends BaseActivity implements View.OnClickListener{
    private LinearLayout back_lay;
    private TextView addFriend;
    @Override
    public int getLayoutResource() {
        return R.layout.activity_friend;
    }
    @Override
    protected Fragment createFragment() {
        return FriendFragment.newInstance();
    }

    @Override
    protected void findId() {
        back_lay=findViewById(R.id.back_lay);
        addFriend=findViewById(R.id.addFriend);
    }

    @Override
    protected void setupView() {
        back_lay.setOnClickListener(this);
        addFriend.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.back_lay:
                finish();
                break;
            case R.id.addFriend:
                Intent to=new Intent();
                to.putExtra("type","1");
                to.setClass(FriendActivity.this,SearchFriendActivity.class);
                startActivity(to);
                break;
        }
    }
}
